package com.zzyweb.rentalcarsys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyweb.rentalcarsys.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface RoleMapper extends BaseMapper<Role> {
    @Select("select * from role r " +
            "join user_role ur " +
            "on r.role_id = ur.role_id " +
            "where ur.user_id = #{userId}")
    List<Role> selectRolesByUserId(Long userId);
}
